import type { UserAuthItem, UserInfo } from '@/utils/auth'

export interface LoginParams {
  name: string
  password: string
  expiresInDays: number
}

export interface LoginData {
  access_token: string
  userId: number
  username: string
}

export interface UserData {
  auth: Array<UserAuthItem>
  userInfo: UserInfo<number>
}

export interface OperationItem {
  id: number
  name: string
  code: string
  description: string
  createTime: Date
  updateTime: Date
}

export interface RoleItem {
  id: number
  name: string
  code: string
  description: string
  createdById: number
  createdByName: string
  createTime: Date
  updatedById: number
  updatedByName: string
  updateTime: Date
}

export interface MenuItem {
  id: number
  name: string
  zhName: string
  description: string
  component: string
  icon: string
  path: string
  parentId: number
  createTime: Date
  updateTime: Date
  order: number
  checked: boolean
  children?: Array<MenuItem>
}

export interface CanOperationData {
  bindOperationIds: number[]
  bindOperationCodes: string[]
  operationList: Array<OperationItem>
}

export interface PermissionResponse {
  id: number
  menuId: number
  name: string
  permission: string
  type: string
  description: string | null
  createTime: string
  updateTime: string
}

export interface LoggerItem {
  id: number
  userName: string
  userId: number
  ip: string
  url: string
  method: string
  param: string
  userAgent: string
  browser: string
  createTime: Date
}
